package com.awifi.demo.netty.nio;

import java.nio.IntBuffer;
import java.util.Random;

/**
 * @description: ToDo
 * @author: marin
 * @time: 2020/9/2 14:43
 */
public class BasicBuffer {
    public static void main(String[] args) {
        IntBuffer intBuffer = IntBuffer.allocate(5);

        for (int i=0;i < 5; i++) {
            Random random = new Random(10);
            intBuffer.put(i);
        }

        //intBuffer.flip();

        intBuffer.limit(2);
        for (int i = 0; i < intBuffer.capacity();i++) {
            System.out.println(intBuffer.get(i));
        }

    }
}
